package cn.spring.chapter04.controller;

import cn.spring.chapter04.beans.Book;
import cn.spring.chapter04.beans.Book1;
import cn.spring.chapter04.beans.Book2;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;

@RestController
public class BookController {
    @GetMapping("/book")
    public Book book(){
        Book book=new Book();
        book.setAuthor("罗贯中");
        book.setName("三国演义");
        book.setPrice(30f);
        book.setPublicationDate(new Date());
        return  book;
    }
    @GetMapping("/book1")
    public Book1 book1(){
        Book1 book=new Book1();
        book.setAuthor("罗贯中");
        book.setName("三国演义");
        book.setPrice(30f);
        book.setPublicationDate(new Date());
        return  book;
    }
    @GetMapping("/book2")
    public Book2 book2(){
        Book2 book=new Book2();
        book.setAuthor("罗贯中");
        book.setName("三国演义");
        book.setPrice(30f);
        book.setPublicationDate(new Date());
        return  book;
    }


}
